﻿using System.ServiceModel;
using System.ServiceModel.Web;
using UFIDA.U9.WSS.ProxyService.Models;
using UFIDA.U9.WSS.ProxyService.Token;

namespace UFIDA.U9.WSS.ProxyService.Interfaces
{
    /// <summary>
    ///     认证服务
    ///     无参数或只有一个参数时,指定:BodyStyle = WebMessageBodyStyle.Bare
    ///     当存在多个参数时，指定:BodyStyle = WebMessageBodyStyle.WrappedRequest
    /// </summary>
    [ServiceContract]
    internal interface IAuthService
    {
        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        ReturnMessage<TokenReturnData> GetToken(ContextInfo context);

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        ReturnMessage<TokenReturnData> RefreshToken(string accessToken, ContextInfo context);

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        ReturnMessage<string> GetAuth(ContextInfo context);
    }
}